package spring.ioc.xml.service.impl;

import spring.ioc.xml.dao.StudentDao;
import spring.ioc.xml.pojo.Student;
import spring.ioc.xml.service.StudentService;

import java.util.List;

/**
 * description:学生业务接口的实现类
 */
public class StudentServiceImpl implements StudentService {

    // 业务层调用DAO层时，不需要new，只需要调用，由IOC容器管理
    private StudentDao studentDao;

    public void setStudentDao(StudentDao studentDao) {
        this.studentDao = studentDao;
    }

    /**
     * 查询所有学员数据业务
     */
    @Override
    public List<Student> findAll() {
        List<Student> studentList = studentDao.queryAll();
        System.out.println("studentService:"+studentList);
        return studentList;
    }
}
